<div class="path"><i class="iconfont">&#xf108;</i>  <a href="{url('admin/default/welcome')}">开始</a> {$sitename} / <a href="{url('channel/index')}">栏目管理</a>{$path}</div>
<div class="m10">
<div class="table-head"><a href="{url('channel/index',array('id'=>$pid))}" class="button"> <i class="iconfont">&#xf053;</i> 返回</a><strong>添加栏目</strong></div>
<form id="form" action="{url('channel/add')}">
<input type="hidden" name="pid" value="{$pid}"/>
<table class="table">
{if !$pid && !$website_id}
    <tr><th>所属站点:</th><td>
<select class="select" name="website_id" datatype="*">
    <option value="">请选择所属站点</option>
{loop $website $vo}
    <option value="{$vo['id']}" {if $info['website_id'] == $vo['id']}selected="selected"{/if}>{$vo['title']} [ http://{$vo['url']} ]</option>
{/loop}
</select>
    <span class="red">禁止修改,子栏目继承。</span></td></tr>
{/if}
    <tr><th>栏目类型:</th><td>
<select class="select" name="type">
<option value="0">资源列表--[添加内容]</option><option value="1">网站频道--[禁止内容]</option><option value="2">栏目跳转--[直接跳转]</option>
</select>
    </td></tr>
    <tr><th>绑定资源模型:</th><td>
{if $pid == 0}
<select name="mid" class="select" datatype="*">
<option value="">-- 绑定资源模型 --</option>
{loop $lists $rs}{if $rs['type'] == 0}<option value="{$rs['id']}">{$rs['name']}</option>{/if}{/loop}
</select>
<span class="red">禁止修改,子栏目继承。</span>
{else}
<input type="text" name="mid" value="{$list['mid']}" class="input gray-input" style="width:30px" readonly ="readonly"/> <span class="red">禁止修改,因继承根类模型。</span>
{/if}
    </td></tr>
    <tr><th>绑定附加模型:</th><td>
<select name="plus_mid" class="select">
<option value="">-- 绑定附加模型 --</option>
{loop $lists $rs}{if $rs['type'] == 1}<option value="{$rs['id']}">{$rs['name']}</option>{/if}{/loop}
</select><input class="input" name="tpl_plus" id="tpl_plus" type="text" /> <input url="{url('admin/tpl/index',array(id=>'tpl_plus'))}" title="附加模型模板选择" value="模板选择" type="button" class="button win" />
        </td></tr>
    <tr><th>栏目扩展模型:</th><td>
<select name="exts_mid" class="select">
<option value="0">-- 栏目扩展模型 --</option>
{loop $lists $rs}{if $rs['type'] == 2}<option value="{$rs['id']}">{$rs['name']}</option>{/if}{/loop}
</select>
        </td></tr>
    <tr><th>栏目名称:</th><td><input class="input w200" datatype="*" type="text" name="name" /</td></tr>
    <tr><th>栏目URL:</th><td><input class="input w300" type="text" name="url" id="url" /> <input url="{url('channel/linkurl',array(id=>'url'))}" title="站内链接选择" value="站内链接" type="button" class="button win" /></td></tr>
    <tr><th>前台是否显示:</th><td>
        显示: <input checked="checked" class="radio" type="radio" name="locks" value="1">
        不显示: <input class="radio" type="radio" name="locks" value="0">
    </td></tr>
    <tr><th>栏目模板:</th><td>
        <input class="input" name="tpl_list" id="tpl_list" type="text" />
        <input url="{url('admin/tpl/index',array(id=>'tpl_list'))}" title="栏目模板选择" value="模板选择" type="button" class="button win" />
    </td></tr>
    <tr><th>内容模板:</th><td>
        <input class="input" name="tpl_content" id="tpl_content" type="text" />
        <input url="{url('admin/tpl/index',array(id=>'tpl_content'))}" title="内容模板选择" value="模板选择" type="button" class="button win" />
    </td></tr>
</table>
<div class="btn fn-tac">
  <a href="{url('channel/index',array('id'=>$pid))}" class="button"> <i class="iconfont" title="模型列表">&#xf053;</i> 返回</a>
  <input type="submit" value="确定保存" class="button button-blue" />
  <input type="reset" value="重置" class="button button-yellow" />
</div>
</form>
</div>
<script type="text/javascript">
Do('base','dialog','form',function(){ 
    $('#form').forms();
    $(".win").click(function(){$(this).win();});
})      
</script>